version: "0.1"

services:
  # Runs the go-ethereum archive node.
  geth:
    image: "ethereum/client-go:latest"
    container_name: geth_arhcive_node
    restart: always
    command:
      - --http
      - --http.api=eth,net,web3
      - --http.addr=0.0.0.0
      - --http.corsdomain=*
      - --ws
      - --ws.api=eth,net,web3
      - --ws.addr=0.0.0.0
      - --ws.origins=*
      - --authrpc.vhosts=*
      - --authrpc.addr=0.0.0.0  
      - --nodiscover
      - --syncmode=full
      - --gcmode=archive 
      - --datadir=execution
    ports:
      - 8551:8551
      - 8545:8545
      - 8546:8546
    volumes:
      - ./execution:/execution
      - ./jwtsecret:/jwtsecret
    depends_on:
      beacon-chain:
        condition: service_started

  # Runs the prysm beacon-chain consensus client.
  beacon-chain:
    image: "gcr.io/prysmaticlabs/prysm/beacon-chain:v4.0.8"
    container_name: validator_client
    restart: always
    command:
      - --datadir=/consensus/beacondata
      # No peers to sync with in this testnet, so setting to 0
      - --min-sync-peers=0
      - --genesis-state=/consensus/genesis.ssz
      - --interop-eth1data-votes
      - --chain-con      
      - --bootstrap-node=fig-file=/consensus/config.yaml
      # We specify the chain id used by our execution client
      - --contract-deployment-block=0
      - --chain-id=32382
      - --rpc-host=0.0.0.0
      - --grpc-gateway-host=0.0.0.0
      - --execution-endpoint=http://geth:8551
      - --accept-terms-of-use
      - --jwt-secret=./jwtsecret/jwt.hex
      - --minimum-peers-per-subnet=0
      - --enable-debug-rpc-endpoints
      - --slots-per-archive-point=32
    depends_on:
      create-beacon-chain-genesis:
        condition: service_completed_successfully
    ports:
      - 4000:4000
      - 3500:3500
      - 8080:8080
      - 6060:6060
      - 9090:9090
    volumes:
      - ./consensus:/consensus
      - ./execution:/execution
      - ./jwtsecret:/jwtsecret

